home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
drdobbs
/
1988
/
04
/
thompson
/
thompson.exm
Wrap
Text File
|
1979-12-31
|
2KB
|
69 lines
topic 'which language'
ask ('What #mlanguage#m do you want to know more about ?',want,
[Pascal,C,Lisp,Prolog]).
do (?want).
topic language.
window ().
say('
Some people make a distinction between AI and
"conventional" programming languages. Though individual
languages certainly differ, for the most part, an AI language
is one that was developed at a place where they happen to be
doing AI.').
close_window ().
end. (* language *)
topic Pascal.
say ('
When using Pascal to solve "AI types" of problems, you
usually have to design low-level routines to implement linked
list structures.').
end. (* Pascal *)
(* topics for C, Lisp and Prolog would go here *)
end. (* which language *)
Example 1: Fragment of a KnowledgePro program, or knowledge base
say ('One of the powerful features of #mLisp#m is the ability
to easily manipulate #mlist structures#m.').
topic mark (find).
text = read ('threads.fil', concat ('/',?find), '/end').
window ().
say (?text).
close_window ().
end. (* mark *)
Example 2: Using the default topic mark with hypertext
topic animal.
:legs = 4. (* The default number of legs for an animal *)
dog (). (* These commands are used for initialization *)
cat ().
bird ().
say ('
A dog has ',?dog:legs,' legs.
A cat has ',?cat:legs,' legs.
A bird has ',?bird:legs,' legs.').
topic dog.
end. (* dog *)
topic cat.
end. (* cat *)
topic bird.
:legs = 2. (* override the default *)
end. (* bird *)
end. (* animal *)
Example 3: Nested topics showing how values are inherited